{% extends 'common/base.html'%}

{% block head %}
	<link rel="stylesheet" href="{% static 'css/index.min.css' %}">
	<style>
		.search {
			width:100%;
			height:200px;
			line-height:200px;
			text-align:center;
			position:relative;
		}
	</style>
	<script src = '{% static 'js/jquery-3.3.1.min.js'%}'></script>
	<script src = '{% static 'js/index.min.js'%}'></script>	
{% endblock%}

{% block title%}
	首页
{% endblock%}

{% block main%}
	<div class="main">
		<div class="wrapper">
			<div class="main-content-wrapper">
				<div class="banner-group">
					<form action="" method="post" class='search'>
						{% csrf_token %}
						<input type="text" placeholder="请输入关键字" style="width:700px;height:40px;border:solid 2px #f7766a;" name="contents">
						<input type="submit" value="查询" style="height:40px;width:60px;background:#f7766a;border:none;">
					</form>
				</div>
				
				<div class="list-outer-group">					
					<ul class="list-tab">
						<li><a href="" class="special-a">搜索结果</a></li>
					</ul>					
					
					<ul class="list-inner-group">
						{% for new in news %}
							<li>
								<div class="thumbnall-group">
									<a href="{% url 'news_detail' new_id=new.id %}"><img src="/media/{{new.thumbnail}}" alt=""></a>
								</div>

								<div class="news-group">
									<p class="title"><a href="{% url 'news_detail' new_id=new.id %}">{{new.title}}</a></p>
									<p class="desc">{{new.desc}}</p>
									<p class="more">
										<span class="left-more">{{new.category.name}}</span>
										<span class="right-more">{{new.pub_time}}</span>
										<span class="right-more">{{new.author.username}}</span>	
									</p>
								</div>
							</li>
						{% endfor %}
					</ul>
		
				</div>

<!-- 				<div class="load-more-group">
					<button class="load-more">加载更多</button>
				</div> -->
			</div>

			{% include 'common/sidebar.html' %}
		</div>
	</div>	
{% endblock%}